package com.googlecode.tracey.id;

public class TraceyIdValue {
    private final String value;

    public static TraceyIdValue traceyIdValue(String v) {
        return new TraceyIdValue(v);
    }

    private TraceyIdValue(String value) {
        this.value = value;
    }

    public String value() {
        return value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TraceyIdValue that = (TraceyIdValue) o;

        return !(value != null ? !value.equals(that.value) : that.value != null);

    }

    @Override
    public int hashCode() {
        return value != null ? value.hashCode() : 0;
    }

    @Override
    public String toString() {
        return value;
    }

    public boolean hasValue() {
        return value != null;
    }
}
